package org.cerberus.platform;

import static org.cerberus.platform.api.PlatformUtilities.*;

import java.util.List;

import org.cerberus.platform.api.PAttribute;
import org.cerberus.platform.api.PComponent;

@PComponent(classID = ClientIDs.PLATFORM_ROOT, root=true)
public class PlatformRoot {

	@PAttribute()
	private List<Object> components;
	 
	PlatformRoot() {
		getPlatform().inject(this);
	}
	
	public void addComponent(Object component) {
		boolean changed = components.add(component);
		if (changed) {
			change(this, "components");
		}
	}
	
	public void removeComponent(Object component) {
		boolean contained = components.remove(component);
		if (contained) {
			change(this, "components");
		}
	}
	
}
